<?php
function DirTest($path){
    $handle=opendir($path);
	while (($item=readdir($handle))!==false) {
		if(is_file($path.DIRECTORY_SEPARATOR.$item)){
			$arr['file'][]=$path.DIRECTORY_SEPARATOR.$item;
		}else{
			$arr['dir'][]=$path.DIRECTORY_SEPARATOR.$item;
		}
	}
	return $arr;
}